﻿SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
GO

ALTER PROCEDURE [dbo].[bhp_PayU_PaymentTransactionLog] (
	@TransactionId int,
	@PosId int,
	@PosAuthKey nchar(7),
	@PaymentType nvarchar(10),
	@ChargeValue numeric(12, 2),
	@Description nvarchar(50),
	@FirstName nvarchar(100),
	@LastName nvarchar(100),
	@EMail nvarchar(100),
	@ClientIP nvarchar(15),
	@Status int,
	@OrderID int,
	@Description2 nvarchar(1024),
	@DescriptionBank nvarchar(27),
	@Street nvarchar(10),
	@StreetNumber nvarchar(10),
	@FlatNumber nvarchar(10),
	@City nvarchar(100),
	@PostCode nvarchar(20),
	@Country nvarchar(100),
	@Phone nvarchar(100),
	@Language char(10),
	@JavaScript bit,
	@PaybackLogin nvarchar(40),
	@Sig nvarchar(32),
	@Ts nvarchar(1000),
	@SessionId nvarchar(50),
	@CreatedDate datetime,
	@BeginDate datetime = NULL,
	@SentDate datetime = NULL,
	@ReceiveDate datetime = NULL,
	@CancelDate datetime = NULL
)
AS
BEGIN
	INSERT INTO bht_PayU_PaymentTransactionLog (
		[TransactionId],
		[PosId],
		[PosAuthKey],
		[PaymentType],
		[ChargeValue],
		[Description],
		[FirstName],
		[LastName],
		[EMail],
		[ClientIP],
		[Status],
		[OrderID],
		[Description2],
		[DescriptionBank],
		[Street],
		[StreetNumber],
		[FlatNumber],
		[City],
		[PostCode],
		[Country],
		[Phone],
		[Language],
		[JavaScript],
		[PaybackLogin],
		[Sig],
		[Ts],
		[SessionId],
		[CreatedDate],
		[BeginDate],
		[SentDate],
		[ReceiveDate],
		[CancelDate]
	) VALUES (
		@TransactionId,
		@PosId,
		@PosAuthKey,
		@PaymentType,
		@ChargeValue,
		@Description,
		@FirstName,
		@LastName,
		@EMail,
		@ClientIP,
		@Status,
		@OrderID,
		@Description2,
		@DescriptionBank,
		@Street,
		@StreetNumber,
		@FlatNumber,
		@City,
		@PostCode,
		@Country,
		@Phone,
		@Language,
		@JavaScript,
		@PaybackLogin,
		@Sig,
		@Ts,
		@SessionId,
		@CreatedDate,
		@BeginDate,
		@SentDate,
		@ReceiveDate,
		@CancelDate
	)
	
	SELECT @@IDENTITY as LogId
END